package br.ufpe.cin.analysis.plugin.entities;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@XmlRootElement(name = "metric")
@XmlType( propOrder = { "name", "value", "marginError", "selected" } )
public class Metric implements ISelectable{
	
	
	private String name;
	private double value;
	private double marginError;
	private boolean selected;
	
	public Metric(String name, double value, double marginError)
	{
		this.name = name;
		this.value = value;
		this.marginError = marginError;
		this.selected = true;
	}
	
	public Metric(String name, double value)
	{
		this(name,value,0.0);
	}
	
	public Metric()
	{
		this(null,0.0,0.0);
	}
	
	@XmlElement(name = "metricName")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public double getValue() {
		return value;
	}

	public void setValue(double value) {
		this.value = value;
	}

	public double getMarginError() {
		return marginError;
	}

	public void setMarginError(double marginError) {
		this.marginError = marginError;
	}
	
	
	
	public String toString()
	{
		return "Metric: " + this.name;
	}

	public boolean getSelected() {
		return this.selected;
	}

	public void setSelected(boolean selected) {
		this.selected = selected;
		
	}
	
	
	
	
	
	

}
